<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller{
    public function index(){

//        $this->db->where();
        $data['title'] = '主页 - 陈先森&陈太太';
        $data['ava_index'] = '1';
        $this->db->where('type',3);
        $this->db->order_by("order", "asc");
        $growqy = $this->db->get('pic');
        $data['grow'] = $growqy->result_array();




        $this->db->where('type',1);
        $this->db->limit(8);
        $this->db->order_by("ctime", "desc");
        $growqy = $this->db->get('pic');
        $data['list'] = $growqy->result_array();



        //trip records
        $this->db->where('type',1);
        $this->db->limit(3);
        $this->db->order_by("playtime", "desc");
        $growqy = $this->db->get('trip');
        $data['trip_list'] = $growqy->result_array();
//        var_dump($grow);

        $this->load->view('index/header' , $data);
        $this->load->view('index/home');
        $this->load->view('index/footer');
    }
    public function header(){
        $this->load->view();
    }
}
